package com.shuorikeji.huohuo.mvp;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;

import com.shuorikeji.huohuo.base.RxBasePresenter;
import com.shuorikeji.huohuo.bean.AdCountMainBean;
import com.shuorikeji.huohuo.bean.AddSjMainBean;
import com.shuorikeji.huohuo.bean.AllBookMainBean;
import com.shuorikeji.huohuo.bean.AllSortMainBean;
import com.shuorikeji.huohuo.bean.BaseInfoBean;
import com.shuorikeji.huohuo.bean.BookDetailMainBean;
import com.shuorikeji.huohuo.bean.BookFlMainBean;
import com.shuorikeji.huohuo.bean.BookPlMainBean;
import com.shuorikeji.huohuo.bean.BookReadHisMainBean;
import com.shuorikeji.huohuo.bean.BookSjMainBean;
import com.shuorikeji.huohuo.bean.BookZjDetailMainBean;
import com.shuorikeji.huohuo.bean.BookZjMainBean;
import com.shuorikeji.huohuo.bean.DjDetailMainBean;
import com.shuorikeji.huohuo.bean.DjHisMainBean;
import com.shuorikeji.huohuo.bean.DjMainBean;
import com.shuorikeji.huohuo.bean.DjSjMainBean;
import com.shuorikeji.huohuo.bean.DjTypeMainBean;
import com.shuorikeji.huohuo.bean.FontBgMainBean;
import com.shuorikeji.huohuo.bean.HotSearchMainBean;
import com.shuorikeji.huohuo.bean.HotTagMainBean;
import com.shuorikeji.huohuo.bean.Mh1FlMainBean;
import com.shuorikeji.huohuo.bean.MhDetailInfoMainBean;
import com.shuorikeji.huohuo.bean.MhHotTagMainBean;
import com.shuorikeji.huohuo.bean.MhInfoMainBean;
import com.shuorikeji.huohuo.bean.MhPlMainBean;
import com.shuorikeji.huohuo.bean.MhReadHisMainBean;
import com.shuorikeji.huohuo.bean.MhSdMainBean;
import com.shuorikeji.huohuo.bean.MhSdScMainBean;
import com.shuorikeji.huohuo.bean.MhSdXqBean;
import com.shuorikeji.huohuo.bean.MhSjMainBean;
import com.shuorikeji.huohuo.bean.MhZjDetailInfoMainBean;
import com.shuorikeji.huohuo.bean.MhZjInfoMainBean;
import com.shuorikeji.huohuo.bean.MsgMainBean;
import com.shuorikeji.huohuo.bean.SearchHistoryMainBean;
import com.shuorikeji.huohuo.bean.TjBookMainBean;
import com.shuorikeji.huohuo.bean.TjMainBean;
import com.shuorikeji.huohuo.bean.UserInfoMainBean;
import com.shuorikeji.huohuo.bean.VersionMainBean;
import com.shuorikeji.huohuo.callback.ClickCallBack;
import com.shuorikeji.huohuo.http.HttpSubscriber;
import com.shuorikeji.huohuo.utils.GsonUtil;

public class AllPresenter extends RxBasePresenter {
    AllModel model = new AllModel();

    public void getSecFl(Context context, int flag, int channel_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getSecFl(flag, channel_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "二级分类返回数据：" + httpResult.toString());
                    BookFlMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookFlMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getTjBook(Context context, int page, int limit, int channel, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getTjBook(page, limit, channel).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取推荐书籍列表：" + httpResult.toString());
                    TjBookMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), TjBookMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    /**
     * 获取所有书籍
     *
     * @param flag  1新书严选
     *              2潜力新书
     *              3新书首发
     *              4精选
     *              5banner
     *              6完结甄选
     *              7热门标签书籍
     *              8会员书库
     *              9大家都在看
     *              10搜索
     *              11同一作者
     *              12相似性
     *              13会员分类页-书库
     * @param sort  2新书首发 潜力新书（需要）
     * @param score 1潜力新书
     */
    public void getAllBook(Context context, int flag, int sort, int limit, int page,
                           String search, int novel_channel_id, int novel_category_id,
                           int is_hot, int tag_id, int completed, int is_vip, int word_num, int score,
                           int winnow, int banner, String author, int subclassification_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getAllBook(flag, sort, limit, page, search, novel_channel_id, novel_category_id,
                is_hot, tag_id, completed, is_vip, word_num, score, winnow, banner, author, subclassification_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", flag + "---获取所有书籍返回数据：" + httpResult.toString());
                    AllBookMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), AllBookMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void cYouLike(Context context, int page, int limit, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.cYouLike(page, limit).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "猜你喜欢接口返回数据：" + httpResult.toString());
                    TjBookMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), TjBookMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getHotTag(Context context, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getHotTag().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取热门标签列表返回数据：" + httpResult.toString());
                    HotTagMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), HotTagMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getUserInfo(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getUserInfo().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取用户信息返回数据：" + httpResult.toString());
                    UserInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), UserInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    /**
     * @param context  上下文
     * @param page     页码
     * @param novel_id 书籍id
     * @param limit    页数
     * @param is_new   传1是新的在前边 传0是老的在前边 获取全部评论的时候，star参数不传
     * @param star     评论星级
     * @param show     是否显示进度
     * @param callBack 回调
     */
    public void getBookPl(Context context, int flag, int page, int novel_id, int limit, int is_new, int star, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getBookPl(flag, page, novel_id, limit, is_new, star).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "书籍评论列表返回数据：" + httpResult.toString());
                    BookPlMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookPlMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getBookDetail(Context context, int id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getBookDetail(id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "书籍详情返回数据：" + httpResult.toString());
                    BookDetailMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookDetailMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void addSj(Context context, int novel_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.addSj(novel_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加书架返回数据：" + httpResult.toString());
                    AddSjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), AddSjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "未登录或其他问题");
            }
        }));
    }

    public void getBookZj(Context context, int page, int limit, int novel_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getBookZj(page, limit, novel_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "书籍目录返回数据：" + httpResult.toString());
                    BookZjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookZjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "未登录或其他问题");
            }
        }));
    }

    public void login(String mobile, String code, String invite, String event, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.login(mobile, code, invite, event).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "登录返回数据：" + httpResult.toString());
                    UserInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), UserInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getFontBg(Context context, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getFontBg().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取字体和背景列表返回数据：" + httpResult.toString());
                    FontBgMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), FontBgMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void setReadBg(Context context, int back_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.setReadBg(back_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "设置书籍阅读背景返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void setFont(Context context, int font_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.setFont(font_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "设置字体返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getBookZjDetail(Context context, int novel_id, int chapter_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getBookZjDetail(novel_id, chapter_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "书籍章节详情返回数据：" + httpResult.toString());
                    BookZjDetailMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookZjDetailMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                if (e.getMessage().contains("HTTP 501")) {
                    //需要看广告解锁
                } else {
                    callBack.onClick(2, "接口调用失败");
                }
            }
        }));
    }

    public void addReadHis(Context context, int chapter_id, int novel_id, int position, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.addReadHis(chapter_id, novel_id, position).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加阅读历史返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void jbBookZj(Context context, String type, String content, int chapter_id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.jbBookZj(type, content, chapter_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "举报章节返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getAllSort(Context context, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getAllSort().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取所有分类返回数据：" + httpResult.toString());
                    AllSortMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), AllSortMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void plBook(Context context, int star, int novel_id, String content, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.plBook(star, novel_id, content).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "评论书籍返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    public void getMh1Fl(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getMh1Fl().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取漫画一级分类返回数据：" + httpResult.toString());
                    Mh1FlMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), Mh1FlMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "无数据");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "接口调用失败");
            }
        }));
    }

    /**
     * @param flag 1根据一级分类
     *             2搜索
     *             3同一作者
     *             4同一类型
     *             5每日推荐
     */
    public void getAllMh(int flag, int sort, int limit, int page,
                         String search, String author, int novel_channel_id, int novel_category_id,
                         int is_hot, int tag_id, int completed, int is_vip, int word_num, int score,
                         int winnow, int banner, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getAllMh(flag, sort, limit, page, search, author, novel_channel_id, novel_category_id,
                is_hot, tag_id, completed, is_vip, word_num, score, winnow, banner).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", flag + "---获取所有漫画返回数据：" + httpResult.toString());
                    MhInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取所有漫画无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取所有漫画接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取所有漫画接口调用失败");
            }
        }));
    }

    public void getJxMh(int limit, int page, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getJxMh(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取精选漫画返回数据：" + httpResult.toString());
                    MhInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取精选漫画无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取精选漫画:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取精选漫画接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取精选漫画接口调用失败");
            }
        }));
    }

    public void mhSearchHistory(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.mhSearchHistory().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画搜索历史返回数据：" + httpResult.toString());
                    SearchHistoryMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), SearchHistoryMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画无搜索历史");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取漫画搜索历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取漫画搜索历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取漫画搜索历史接口调用失败");
            }
        }));
    }

    public void bookSearchHistory(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.bookSearchHistory().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "小说搜索历史返回数据：" + httpResult.toString());
                    SearchHistoryMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), SearchHistoryMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "小说无搜索历史");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取小说搜索历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取小说搜索历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取小说搜索历史接口调用失败");
            }
        }));
    }

    public void deleteBookSearHis(int id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.deleteBookSearHis(id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "删除小说搜索历史返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "删除小说搜索历史失败");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "删除小说搜索历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "删除小说搜索历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "删除小说搜索历史接口调用失败");
            }
        }));
    }

    public void deleteMhSearHis(int id, boolean show, ClickCallBack callBack) {
        mRxManage.add(model.deleteMhSearHis(id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "删除漫画搜索历史返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "删除漫画搜索历史失败");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "删除漫画搜索历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "删除漫画搜索历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "删除漫画搜索历史接口调用失败");
            }
        }));
    }

    public void mhHotSearch(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.mhHotSearch().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画热门搜索返回数据：" + httpResult.toString());
                    HotSearchMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), HotSearchMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画热门搜索无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画热门搜索:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画热门搜索接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画热门搜索接口调用失败");
            }
        }));
    }

    public void bookHotSearch(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.bookHotSearch().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "小说热门搜索返回数据：" + httpResult.toString());
                    HotSearchMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), HotSearchMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "小说热门搜索无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "小说热门搜索:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "小说热门搜索接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画热门搜索接口调用失败");
            }
        }));
    }

    public void getMhDetail(boolean show, int id, ClickCallBack callBack) {
        mRxManage.add(model.getMhDetail(id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取漫画详情返回数据：" + httpResult.toString());
                    MhDetailInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhDetailInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取漫画详情无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取漫画详情:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取漫画详情接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取漫画详情接口调用失败");
            }
        }));
    }

    public void getMhZjList(boolean show, int id, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.getMhZjList(id, limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取漫画章节列表返回数据：" + httpResult.toString());
                    MhZjInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhZjInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取漫画章节列表无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取漫画章节列表:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取漫画章节列表接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取漫画章节列表接口调用失败");
            }
        }));
    }

    public void getMhPlList(boolean show, int cartoon_id, int is_new, int page, int limit, ClickCallBack callBack) {
        mRxManage.add(model.getMhPlList(cartoon_id, is_new, page, limit).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取漫画评价列表返回数据：" + httpResult.toString());
                    MhPlMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhPlMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取漫画评价列表无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取漫画评价列表:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取漫画评价列表接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取漫画评价列表接口调用失败");
            }
        }));
    }

    public void getMhZjDetail(boolean show, int id, int chapter_id, ClickCallBack callBack) {
        mRxManage.add(model.getMhZjDetail(id, chapter_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取漫画章节详情返回数据：" + httpResult.toString());
                    MhZjDetailInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhZjDetailInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取漫画章节详情无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取漫画章节详情:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取漫画章节详情接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取漫画章节详情接口调用失败");
            }
        }));
    }

    public void addMhPl(boolean show, int star, int cartoon_id, String content, ClickCallBack callBack) {
        mRxManage.add(model.addMhPl(star, cartoon_id, content).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加评论返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "添加评论无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "添加评论:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "添加评论接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "添加评论接口调用失败");
            }
        }));
    }

    public void djTypeTree(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.djTypeTree().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "短剧分类树返回数据：" + httpResult.toString());
                    DjTypeMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), DjTypeMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "短剧分类树无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "短剧分类树:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "短剧分类树接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "短剧分类树接口调用失败");
            }
        }));
    }

    /**
     * @param channel 频道:1=男频;2=女频
     * @param ym      年月:格式 2022-09
     * @param source  来源：0=全部，1=自制剧（默认）,2=穿山甲剧
     */
    public void djList(boolean show, int page, int limit, int channel, int cat_id, String keyword, String ym, int source, ClickCallBack callBack) {
        mRxManage.add(model.djList(page, limit, channel, cat_id, keyword, ym, source).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "短剧列表返回数据：" + httpResult.toString());
                    DjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), DjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "短剧列表无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "短剧列表:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "短剧列表接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "短剧列表接口调用失败");
            }
        }));
    }

    public void djDetail(boolean show, long id, int type, String csj, ClickCallBack callBack) {
        mRxManage.add(model.djDetail(id, type, csj).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "短剧详情返回数据：" + httpResult.toString());
                    DjDetailMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), DjDetailMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "短剧详情无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "短剧详情:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "短剧详情接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "短剧详情接口调用失败");
            }
        }));
    }

    public void djDz(boolean show, int vid, int mid, ClickCallBack callBack) {
        mRxManage.add(model.djDz(vid, mid).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加/取消喜欢短剧剧集返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "添加/取消喜欢短剧剧集无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "添加/取消喜欢短剧剧集:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "添加/取消喜欢短剧剧集接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "添加/取消喜欢短剧剧集接口调用失败");
            }
        }));
    }

    public void bookSjList(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.bookSjList(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取小说书架列表返回数据：" + httpResult.toString());
                    BookSjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookSjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取小说书架列表无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取小说书架列表:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取小说书架列表接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取小说书架列表接口调用失败");
            }
        }));
    }

    public void mhSjList(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.mhSjList(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取漫画书架列表返回数据：" + httpResult.toString());
                    MhSjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhSjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取漫画书架列表无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取漫画书架列表:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取漫画书架列表接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取漫画书架列表接口调用失败");
            }
        }));
    }

    public void addMhSj(boolean show, int cartoon_id, ClickCallBack callBack) {
        mRxManage.add(model.addMhSj(cartoon_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画添加书架返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画添加书架无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画添加书架:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画添加书架接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画添加书架接口调用失败");
            }
        }));
    }

    public void deleteMhSj(boolean show, int cartoon_id, ClickCallBack callBack) {
        mRxManage.add(model.deleteMhSj(cartoon_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画删除书架返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画删除书架无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画删除书架:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画删除书架接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画删除书架接口调用失败");
            }
        }));
    }

    public void addDeleteZj(boolean show, int vid, int mid, long look_time, ClickCallBack callBack) {
        mRxManage.add(model.addDeleteZj(vid, mid, look_time).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加/取消追剧返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "添加/取消追剧无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "添加/取消追剧:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "添加/取消追剧接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "添加/取消追剧接口调用失败");
            }
        }));
    }

    public void zjJlList(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.zjJlList(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "追剧记录返回数据：" + httpResult.toString());
                    DjSjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), DjSjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "追剧记录无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "追剧记录:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "追剧记录接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "追剧记录接口调用失败");
            }
        }));
    }

    public void bookReadHis(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.bookReadHis(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "小说阅读历史返回数据：" + httpResult.toString());
                    BookReadHisMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookReadHisMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "小说阅读历史无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "小说阅读历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "小说阅读历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "小说阅读历史接口调用失败");
            }
        }));
    }

    public void commonTask(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.commonTask().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "日常任务返回数据：" + httpResult.toString());
                    BookReadHisMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookReadHisMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "日常任务无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "日常任务:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "日常任务接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "日常任务接口调用失败");
            }
        }));
    }

    public void getAllReadSeeVideoCount(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getAllReadSeeVideoCount().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取全天任意读观看视频次数返回数据：" + httpResult.toString());
                    BookReadHisMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BookReadHisMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取全天任意读观看视频次数无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取全天任意读观看视频次数:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取全天任意读观看视频次数接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取全天任意读观看视频次数接口调用失败");
            }
        }));
    }

    public void mhReadHis(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.mhReadHis(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画阅读历史返回数据：" + httpResult.toString());
                    MhReadHisMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhReadHisMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画阅读历史无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画阅读历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画阅读历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画阅读历史接口调用失败");
            }
        }));
    }

    public void addMhReadHis(boolean show, int cartoon_id, int chapter_id, int position, ClickCallBack callBack) {
        mRxManage.add(model.addMhReadHis(cartoon_id, chapter_id, position).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加漫画阅读历史返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "添加漫画阅读历史无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "添加漫画阅读历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "添加漫画阅读历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "添加漫画阅读历史接口调用失败");
            }
        }));
    }

    public void plAddBookSj(boolean show, String novel_id, ClickCallBack callBack) {
        mRxManage.add(model.plAddBookSj(novel_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "批量添加小说书架返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "批量添加小说书架无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "批量添加小说书架:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "批量添加小说书架接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "批量添加小说书架接口调用失败");
            }
        }));
    }

    public void plDeleteBookHis(boolean show, String id, ClickCallBack callBack) {
        mRxManage.add(model.plDeleteBookHis(id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "批量删除小说阅读历史返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "批量删除小说阅读历史无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "批量删除小说阅读历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "批量删除小说阅读历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "批量删除小说阅读历史接口调用失败");
            }
        }));
    }

    public void plDeleteMhHis(boolean show, String id, ClickCallBack callBack) {
        mRxManage.add(model.plDeleteMhHis(id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "批量删除漫画阅读历史返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "批量删除漫画阅读历史无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "批量删除漫画阅读历史:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "批量删除漫画阅读历史接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "批量删除漫画阅读历史接口调用失败");
            }
        }));
    }

    public void djSeeJl(boolean show, long vl_id, int vid, long min, ClickCallBack callBack) {
        mRxManage.add(model.djSeeJl(vl_id, vid, min).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "短剧浏览记录返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "短剧浏览记录无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "短剧浏览记录:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "短剧浏览记录接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "短剧浏览记录接口调用失败");
            }
        }));
    }

    public void djSeeJlList(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.djSeeJlList(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "短剧浏览记录列表返回数据：" + httpResult.toString());
                    DjHisMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), DjHisMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "短剧浏览记录列表无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "短剧浏览记录列表:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "短剧浏览记录列表接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "短剧浏览记录列表接口调用失败");
            }
        }));
    }

    public void plDelDjJl(boolean show, String ids, ClickCallBack callBack) {
        mRxManage.add(model.plDelDjJl(ids).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "批量删除短剧记录返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "批量删除短剧记录无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "批量删除短剧记录:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "批量删除短剧记录接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "批量删除短剧记录接口调用失败");
            }
        }));
    }

    public void seeMhSd(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.seeMhSd(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "查看漫画书单返回数据：" + httpResult.toString());
                    MhSdMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhSdMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "查看漫画书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "查看漫画书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "查看漫画书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "查看漫画书单接口调用失败");
            }
        }));
    }

    public void mhHotTag(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.mhHotTag(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画热门标签返回数据：" + httpResult.toString());
                    MhHotTagMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhHotTagMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画热门标签无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画热门标签:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画热门标签接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画热门标签接口调用失败");
            }
        }));
    }

    public void addMhSd(boolean show, String title, String content, String tags, int is_privacy, String img, ClickCallBack callBack) {
        mRxManage.add(model.addMhSd(title, content, tags, is_privacy, img).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加漫画书单返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "添加漫画书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "添加漫画书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "添加漫画书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "添加漫画书单接口调用失败");
            }
        }));
    }

    public void myLikeDj(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.myLikeDj(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "我喜欢的短剧返回数据：" + httpResult.toString());
                    DjSjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), DjSjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "我喜欢的短剧无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "我喜欢的短剧:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "我喜欢的短剧接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "我喜欢的短剧接口调用失败");
            }
        }));
    }

    public void myMsg(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.myMsg(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "我的消息返回数据：" + httpResult.toString());
                    MsgMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MsgMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "我的消息无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "我的消息:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "我的消息接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "我的消息接口调用失败");
            }
        }));
    }

    /**
     * 意见反馈
     *
     * @param show        show
     * @param feedback    feedback
     * @param report_type report_type
     * @param source      1=意见反馈;2=举报（report_type 必须选择）
     * @param imgurl      imgurl
     * @param mobile      mobile
     * @param callBack    回调
     */
    public void userYjfk(boolean show, String feedback, String report_type, int source, String imgurl, String mobile, ClickCallBack callBack) {
        mRxManage.add(model.userYjfk(feedback, report_type, source, imgurl, mobile).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "用户意见问题反馈返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "用户意见问题反馈无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "用户意见问题反馈:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "用户意见问题反馈接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "用户意见问题反馈接口调用失败");
            }
        }));
    }

    public void scMhSd(boolean show, int book_list_id, ClickCallBack callBack) {
        mRxManage.add(model.scMhSd(book_list_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "收藏漫画书单返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "收藏漫画书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "收藏漫画书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "收藏漫画书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "收藏漫画书单接口调用失败");
            }
        }));
    }

    public void qxScMhSd(boolean show, int book_list_id, ClickCallBack callBack) {
        mRxManage.add(model.qxScMhSd(book_list_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "取消收藏漫画书单返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "取消收藏漫画书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "取消收藏漫画书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "取消收藏漫画书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "取消收藏漫画书单接口调用失败");
            }
        }));
    }

    public void dzMhSd(boolean show, int book_list_id, ClickCallBack callBack) {
        mRxManage.add(model.dzMhSd(book_list_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "点赞漫画书单返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "点赞漫画书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "点赞漫画书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "点赞漫画书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "点赞漫画书单接口调用失败");
            }
        }));
    }

    public void qxDzMhSd(boolean show, int book_list_id, ClickCallBack callBack) {
        mRxManage.add(model.qxDzMhSd(book_list_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "取消点赞漫画书单返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "取消点赞漫画书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "取消点赞漫画书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "取消点赞漫画书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "取消点赞漫画书单接口调用失败");
            }
        }));
    }

    public void myScMhSd(boolean show, int limit, int page, ClickCallBack callBack) {
        mRxManage.add(model.myScMhSd(limit, page).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "我收藏的漫画书单返回数据：" + httpResult.toString());
                    MhSdScMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhSdScMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "我收藏的漫画书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "我收藏的漫画书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "我收藏的漫画书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "我收藏的漫画书单接口调用失败");
            }
        }));
    }

    public void mhSdDetail(boolean show, int book_list_id, ClickCallBack callBack) {
        mRxManage.add(model.mhSdDetail(book_list_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画书单详情返回数据：" + httpResult.toString());
                    MhSdXqBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhSdXqBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画书单详情无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画书单详情:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画书单详情接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画书单详情接口调用失败");
            }
        }));
    }

    public void addMhToSd(boolean show, int book_list_id, int cartoon_id, ClickCallBack callBack) {
        mRxManage.add(model.addMhToSd(book_list_id, cartoon_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "添加漫画到书单返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "添加漫画到书单无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "添加漫画到书单:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "添加漫画到书单接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "添加漫画到书单接口调用失败");
            }
        }));
    }

    public void delSdMh(boolean show, int id, ClickCallBack callBack) {
        mRxManage.add(model.delSdMh(id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "删除书单里的漫画返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "删除书单里的漫画无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "删除书单里的漫画:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "删除书单里的漫画接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "删除书单里的漫画接口调用失败");
            }
        }));
    }

    public void xgUserInfo(boolean show, String avatar, String nickname, ClickCallBack callBack) {
        mRxManage.add(model.xgUserInfo(avatar, nickname).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "修改用户信息返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "修改用户信息无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "修改用户信息:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "修改用户信息接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "修改用户信息接口调用失败");
            }
        }));
    }

    public void qbDsyMx(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.qbDsyMx().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "钱包待使用明细返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "钱包待使用明细无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "钱包待使用明细:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "钱包待使用明细接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "钱包待使用明细接口调用失败");
            }
        }));
    }

    public void mhSdGc(boolean show, int limit, int page, String hot, String news, ClickCallBack callBack) {
        mRxManage.add(model.mhSdGc(limit, page, hot, news).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "书单广场返回数据：" + httpResult.toString());
                    MhSdMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhSdMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "书单广场无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "书单广场:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "书单广场接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "书单广场接口调用失败");
            }
        }));
    }

    public void mhEjFl(boolean show, int channel_id, ClickCallBack callBack) {
        mRxManage.add(model.mhEjFl(channel_id).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画二级分类返回数据：" + httpResult.toString());
                    Mh1FlMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), Mh1FlMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画二级分类无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画二级分类:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画二级分类接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画二级分类接口调用失败");
            }
        }));
    }

    public void ztJl(boolean show, int page, int limit, ClickCallBack callBack) {
        mRxManage.add(model.ztJl(page, limit).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "直推记录返回数据：" + httpResult.toString());
                    TjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), TjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "直推记录无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "直推记录:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "直推记录接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "直推记录接口调用失败");
            }
        }));
    }

    public void tcLogin(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.tcLogin().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "退出登录返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "退出登录无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "退出登录:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "退出登录接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "退出登录接口调用失败");
            }
        }));
    }

    public void zxZh(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.zxZh().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "注销账号返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "注销账号无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "注销账号:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "注销账号接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "注销账号接口调用失败");
            }
        }));
    }

    public void mhCnLike(boolean show, int page, int limit, ClickCallBack callBack) {
        mRxManage.add(model.mhCnLike(page, limit).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "漫画猜你喜欢返回数据：" + httpResult.toString());
                    MhInfoMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), MhInfoMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "漫画猜你喜欢无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "漫画猜你喜欢:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "漫画猜你喜欢接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "漫画猜你喜欢接口调用失败");
            }
        }));
    }

    public void tx(boolean show, double money, int send_type, int id, int type, ClickCallBack callBack) {
        mRxManage.add(model.tx(money, send_type, id, type).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "提现返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "提现无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "提现:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "提现接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "提现接口调用失败");
            }
        }));
    }

    public void aliPaySq(boolean show, String code, ClickCallBack callBack) {
        mRxManage.add(model.aliPaySq(code).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "支付宝授权返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "支付宝授权无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "支付宝授权:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "支付宝授权接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "支付宝授权接口调用失败");
            }
        }));
    }

    public void getNewVersion(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getNewVersion().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取最新版本返回数据：" + httpResult.toString());
                    VersionMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), VersionMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取最新版本无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取最新版本:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取最新版本接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取最新版本接口调用失败");
            }
        }));
    }

    public void getSeeAdCount(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getSeeAdCount().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "获取看广告次数返回数据：" + httpResult.toString());
                    AdCountMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), AdCountMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "获取看广告次数无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "获取看广告次数:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "获取看广告次数接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "获取看广告次数接口调用失败");
            }
        }));
    }

    public void getBookAdJl(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getBookAdJl().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "领取观看小说广告奖励返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "领取观看小说广告奖励无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "领取观看小说广告奖励:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "领取观看小说广告奖励接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "领取观看小说广告奖励接口调用失败");
            }
        }));
    }

    public void getMhAdJl(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.getMhAdJl().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "领取观看漫画广告奖励返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "领取观看漫画广告奖励无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "领取观看漫画广告奖励:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "领取观看漫画广告奖励接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "领取观看漫画广告奖励接口调用失败");
            }
        }));
    }

    public void djAdJsDj(boolean show, int ad_id, int vl_id, int weigh, int type, ClickCallBack callBack) {
        mRxManage.add(model.djAdJsDj(ad_id, vl_id, weigh, type).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "观看短剧广告解锁视频返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "观看短剧广告解锁视频无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "观看短剧广告解锁视频:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "观看短剧广告解锁视频接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "观看短剧广告解锁视频接口调用失败");
            }
        }));
    }

    public void jtJl(boolean show, ClickCallBack callBack) {
        mRxManage.add(model.jtJl().subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "间推记录返回数据：" + httpResult.toString());
                    TjMainBean data = GsonUtil.parseJsonToBean(httpResult.toString(), TjMainBean.class);
                    if (data == null) {
                        callBack.onClick(2, "间推记录无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "间推记录:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "间推记录接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "间推记录接口调用失败");
            }
        }));
    }

    public void allSeeAdDy(boolean show, String source, String ecpm, int ad_source, String sdkName, ClickCallBack callBack) {
        mRxManage.add(model.allSeeAdDy(source, ecpm, ad_source, sdkName).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "观看广告后调用返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "观看广告后调用无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "观看广告后调用:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "观看广告后调用接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "观看广告后调用接口调用失败");
            }
        }));
    }

    public void sendYzm(boolean show, String mobile, String event, ClickCallBack callBack) {
        mRxManage.add(model.sendYzm(mobile, event).subscribe(new HttpSubscriber(this, show) {
            @Override
            public void onNext(Object httpResult) {
                super.onNext(httpResult);
                if (!TextUtils.isEmpty(httpResult.toString())) {
                    Log.i("wxl", "发送验证码返回数据：" + httpResult.toString());
                    BaseInfoBean data = GsonUtil.parseJsonToBean(httpResult.toString(), BaseInfoBean.class);
                    if (data == null) {
                        callBack.onClick(2, "发送验证码无数据");
                    } else {
                        if (data.getCode() == 1) {
                            callBack.onClick(1, data);
                        } else {
                            callBack.onClick(2, "发送验证码:" + data.getMsg());
                        }
                    }
                } else {
                    callBack.onClick(2, "发送验证码接口调用失败");
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
                callBack.onClick(2, "发送验证码接口调用失败");
            }
        }));
    }
}
